home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / expand53.zip / XPDEMO.ZIP / XPINKEY.PRG < prev    next >
Text File  |  1992-08-21  |  1KB  |  40 lines

  1. * ------------------------------------------------------------------------
  2. * Module......:    XPDOS.PRG
  3. * Title.......: DOS part of the Expand Library Demonstration Program
  4. * Author......:    Pepijn Smits.
  5. * Date........:    July/August 1992
  6. * Copyright...:    (c)1992 by Softwarebureau Pepijn Smits
  7. * Notes.......:    Clipper 5.01 Demo of the Expand Library
  8. *        Some general DOS functions
  9. *        See XPDEMO.RMK For Compile and Link instructions.
  10. * ------------------------------------------------------------------------
  11.  
  12. Function XPdemoInkey(n)
  13. /***
  14. * The Inkey Handler for the XPDEMO program
  15. */
  16. Local i,nKey
  17. if N == NIL            // We've gotta continue right away!
  18.     UpdateClock()
  19.     nKey := Inkey()
  20. elseif N == 0            // Wait until Key is Pressed..
  21.     While (nKey := Inkey()) == 0
  22.         UpdateClock()
  23.     end
  24. else                // Wait n seconds for a Key..
  25.     i := n
  26.     While ((nKey := Inkey(1)) == 0) .and. (i>0)
  27.         UpdateClock()
  28.         i--
  29.     end
  30. end
  31. Return (nKey)
  32.  
  33. Static Function UpdateClock()
  34. Local c := SetColor()
  35. MenuColor()
  36. XPdisplay(0,MaxCol()-7,Time())
  37. SetColor(c)
  38. XPcolor()
  39. Return (NIL)
  40.